import { useState } from "react";

const Buttons = props => {
	let num = 12;
	const sendDataToParent = () => {
		const data = "Hello from child";
		props.onChildData(data); // 调用父组件传递的回调函数，并传递参数
	};
	return <button onClick={sendDataToParent}>{props.name}</button>;
};

export default Buttons;
